Skip to content

Conversation

@saturn691
Copy link
Contributor

Reverts #133643

@llvmbot llvmbot added the libc label Aug 12, 2025
@saturn691 saturn691 enabled auto-merge (squash) August 12, 2025 11:35
@llvmbot
Copy link
Member

llvmbot commented Aug 12, 2025

@llvm/pr-subscribers-libc

Author: William Huynh (saturn691)

Changes

Reverts llvm/llvm-project#133643


Patch is 23.74 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/153169.diff

27 Files Affected:

  • (modified) libc/cmake/modules/LLVMLibCTestRules.cmake (+1-1)
  • (modified) libc/test/UnitTest/FPExceptMatcher.cpp (+1-1)
  • (modified) libc/test/UnitTest/FPExceptMatcher.h (+1-1)
  • (modified) libc/test/UnitTest/HermeticTestUtils.cpp (+5-12)
  • (modified) libc/test/UnitTest/LibcDeathTestExecutors.cpp (+1-2)
  • (modified) libc/test/UnitTest/LibcTest.h (+1-1)
  • (modified) libc/test/include/stdbit_stub.h (+21-49)
  • (modified) libc/test/integration/src/pthread/pthread_mutex_test.cpp (+2-2)
  • (modified) libc/test/integration/src/spawn/posix_spawn_test.cpp (+1-2)
  • (modified) libc/test/integration/src/spawn/posix_spawn_test_binary.cpp (+1-1)
  • (modified) libc/test/integration/src/stdio/sprintf_size_test.cpp (+1-1)
  • (modified) libc/test/integration/src/stdlib/getenv_test.cpp (+1-2)
  • (modified) libc/test/integration/src/threads/cnd_test.cpp (+1-1)
  • (modified) libc/test/integration/src/threads/mtx_test.cpp (+2-2)
  • (modified) libc/test/integration/src/unistd/execv_test.cpp (+1-2)
  • (modified) libc/test/integration/src/unistd/execve_test.cpp (+1-2)
  • (modified) libc/test/integration/src/unistd/fork_test.cpp (+1-2)
  • (modified) libc/test/integration/src/unistd/getcwd_test.cpp (+1-2)
  • (modified) libc/test/integration/startup/linux/main_without_envp.cpp (+1-1)
  • (modified) libc/test/integration/startup/linux/tls_test.cpp (+1-2)
  • (modified) libc/test/src/__support/CPP/integer_sequence_test.cpp (+1-2)
  • (modified) libc/test/src/__support/freelist_heap_test.cpp (+1-1)
  • (modified) libc/test/src/math/exhaustive/hypotf16_test.cpp (+2-3)
  • (modified) libc/test/src/stdlib/StrfromTest.h (+2-2)
  • (modified) libc/test/src/string/memory_utils/op_tests.cpp (+3-6)
  • (modified) libc/test/src/strings/bzero_test.cpp (+1-2)
  • (modified) libc/utils/MPFRWrapper/MPFRUtils.h (+2-3)
diff --git a/libc/cmake/modules/LLVMLibCTestRules.cmake b/libc/cmake/modules/LLVMLibCTestRules.cmake
index 44cc6a35df886..30b1fd10a1774 100644
--- a/libc/cmake/modules/LLVMLibCTestRules.cmake
+++ b/libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -40,7 +40,7 @@ function(_get_common_test_compile_options output_var c_test flags)
     endif()
 
     # list(APPEND compile_options "-Wall")
-    list(APPEND compile_options "-Wextra")
+    # list(APPEND compile_options "-Wextra")
     # -DLIBC_WNO_ERROR=ON if you can't build cleanly with -Werror.
     if(NOT LIBC_WNO_ERROR)
       # list(APPEND compile_options "-Werror")
diff --git a/libc/test/UnitTest/FPExceptMatcher.cpp b/libc/test/UnitTest/FPExceptMatcher.cpp
index 9688d53496f94..d66066023984e 100644
--- a/libc/test/UnitTest/FPExceptMatcher.cpp
+++ b/libc/test/UnitTest/FPExceptMatcher.cpp
@@ -31,7 +31,7 @@ namespace testing {
 static thread_local sigjmp_buf jumpBuffer;
 static thread_local bool caughtExcept;
 
-static void sigfpeHandler([[maybe_unused]] int sig) {
+static void sigfpeHandler(int sig) {
   caughtExcept = true;
   siglongjmp(jumpBuffer, -1);
 }
diff --git a/libc/test/UnitTest/FPExceptMatcher.h b/libc/test/UnitTest/FPExceptMatcher.h
index 9b05e83bc1e3a..978501df7e3ed 100644
--- a/libc/test/UnitTest/FPExceptMatcher.h
+++ b/libc/test/UnitTest/FPExceptMatcher.h
@@ -43,7 +43,7 @@ class FPExceptMatcher : public Matcher<bool> {
   // Takes ownership of func.
   explicit FPExceptMatcher(FunctionCaller *func);
 
-  bool match([[maybe_unused]] bool unused) { return exceptionRaised; }
+  bool match(bool unused) { return exceptionRaised; }
 
   void explainError() override {
     tlog << "A floating point exception should have been raised but it "
diff --git a/libc/test/UnitTest/HermeticTestUtils.cpp b/libc/test/UnitTest/HermeticTestUtils.cpp
index 3c82d1e963643..f34a73f3e6805 100644
--- a/libc/test/UnitTest/HermeticTestUtils.cpp
+++ b/libc/test/UnitTest/HermeticTestUtils.cpp
@@ -29,9 +29,7 @@ int atexit(void (*func)(void));
 // add_libc_hermetic_test properly. Such that they won't get correct linkage
 // against the object containing this function. We create a dummy function that
 // always returns 0 to indicate a failure.
-[[gnu::weak]] unsigned long getauxval([[maybe_unused]] unsigned long id) {
-  return 0;
-}
+[[gnu::weak]] unsigned long getauxval(unsigned long id) { return 0; }
 
 } // namespace LIBC_NAMESPACE_DECL
 
@@ -126,7 +124,7 @@ unsigned long __getauxval(unsigned long id) {
 
 } // extern "C"
 
-void *operator new([[maybe_unused]] size_t size, void *ptr) { return ptr; }
+void *operator new(size_t size, void *ptr) { return ptr; }
 
 void *operator new(size_t size) { return malloc(size); }
 
@@ -138,9 +136,7 @@ void operator delete(void *) {
   __builtin_trap();
 }
 
-void operator delete([[maybe_unused]] void *ptr, [[maybe_unused]] size_t size) {
-  __builtin_trap();
-}
+void operator delete(void *ptr, size_t size) { __builtin_trap(); }
 
 // Defining members in the std namespace is not preferred. But, we do it here
 // so that we can use it to define the operator new which takes std::align_val_t
@@ -149,11 +145,8 @@ namespace std {
 enum class align_val_t : size_t {};
 } // namespace std
 
-void operator delete([[maybe_unused]] void *mem, std::align_val_t) noexcept {
-  __builtin_trap();
-}
+void operator delete(void *mem, std::align_val_t) noexcept { __builtin_trap(); }
 
-void operator delete([[maybe_unused]] void *mem, unsigned int,
-                     std::align_val_t) noexcept {
+void operator delete(void *mem, unsigned int, std::align_val_t) noexcept {
   __builtin_trap();
 }
diff --git a/libc/test/UnitTest/LibcDeathTestExecutors.cpp b/libc/test/UnitTest/LibcDeathTestExecutors.cpp
index 5f8d7b86a5187..943e2c23c5fde 100644
--- a/libc/test/UnitTest/LibcDeathTestExecutors.cpp
+++ b/libc/test/UnitTest/LibcDeathTestExecutors.cpp
@@ -22,8 +22,7 @@ namespace LIBC_NAMESPACE_DECL {
 namespace testing {
 
 bool Test::testProcessKilled(testutils::FunctionCaller *Func, int Signal,
-                             const char *LHSStr,
-                             [[maybe_unused]] const char *RHSStr,
+                             const char *LHSStr, const char *RHSStr,
                              internal::Location Loc) {
   testutils::ProcessStatus Result =
       testutils::invoke_in_subprocess(Func, TIMEOUT_MS);
diff --git a/libc/test/UnitTest/LibcTest.h b/libc/test/UnitTest/LibcTest.h
index 5762b49b6066b..fbeafd0bacb75 100644
--- a/libc/test/UnitTest/LibcTest.h
+++ b/libc/test/UnitTest/LibcTest.h
@@ -81,7 +81,7 @@ struct Message {
 // A trivial object to catch the Message, this enables custom logging and
 // returning from the test function, see LIBC_TEST_SCAFFOLDING_ below.
 struct Failure {
-  void operator=([[maybe_unused]] Message msg) {}
+  void operator=(Message msg) {}
 };
 
 struct RunContext {
diff --git a/libc/test/include/stdbit_stub.h b/libc/test/include/stdbit_stub.h
index e08c86271332e..3d2e0fb60334e 100644
--- a/libc/test/include/stdbit_stub.h
+++ b/libc/test/include/stdbit_stub.h
@@ -17,21 +17,11 @@
 #include <stdbool.h> // bool in C
 
 #define STDBIT_STUB_FUNCTION(FUNC_NAME, LEADING_VAL)                           \
-  unsigned FUNC_NAME##_uc([[maybe_unused]] unsigned char x) {                  \
-    return LEADING_VAL##AU;                                                    \
-  }                                                                            \
-  unsigned FUNC_NAME##_us([[maybe_unused]] unsigned short x) {                 \
-    return LEADING_VAL##BU;                                                    \
-  }                                                                            \
-  unsigned FUNC_NAME##_ui([[maybe_unused]] unsigned int x) {                   \
-    return LEADING_VAL##CU;                                                    \
-  }                                                                            \
-  unsigned FUNC_NAME##_ul([[maybe_unused]] unsigned long x) {                  \
-    return LEADING_VAL##DU;                                                    \
-  }                                                                            \
-  unsigned FUNC_NAME##_ull([[maybe_unused]] unsigned long long x) {            \
-    return LEADING_VAL##EU;                                                    \
-  }
+  unsigned FUNC_NAME##_uc(unsigned char x) { return LEADING_VAL##AU; }         \
+  unsigned FUNC_NAME##_us(unsigned short x) { return LEADING_VAL##BU; }        \
+  unsigned FUNC_NAME##_ui(unsigned int x) { return LEADING_VAL##CU; }          \
+  unsigned FUNC_NAME##_ul(unsigned long x) { return LEADING_VAL##DU; }         \
+  unsigned FUNC_NAME##_ull(unsigned long long x) { return LEADING_VAL##EU; }
 
 __BEGIN_C_DECLS
 
@@ -46,42 +36,24 @@ STDBIT_STUB_FUNCTION(stdc_first_trailing_one, 0x1)
 STDBIT_STUB_FUNCTION(stdc_count_zeros, 0x2)
 STDBIT_STUB_FUNCTION(stdc_count_ones, 0x3)
 
-bool stdc_has_single_bit_uc([[maybe_unused]] unsigned char x) { return false; }
-bool stdc_has_single_bit_us([[maybe_unused]] unsigned short x) { return false; }
-bool stdc_has_single_bit_ui([[maybe_unused]] unsigned x) { return false; }
-bool stdc_has_single_bit_ul([[maybe_unused]] unsigned long x) { return false; }
-bool stdc_has_single_bit_ull([[maybe_unused]] unsigned long long x) {
-  return false;
-}
+bool stdc_has_single_bit_uc(unsigned char x) { return false; }
+bool stdc_has_single_bit_us(unsigned short x) { return false; }
+bool stdc_has_single_bit_ui(unsigned x) { return false; }
+bool stdc_has_single_bit_ul(unsigned long x) { return false; }
+bool stdc_has_single_bit_ull(unsigned long long x) { return false; }
 
 STDBIT_STUB_FUNCTION(stdc_bit_width, 0x4)
 
-unsigned char stdc_bit_floor_uc([[maybe_unused]] unsigned char x) {
-  return 0x5AU;
-}
-unsigned short stdc_bit_floor_us([[maybe_unused]] unsigned short x) {
-  return 0x5BU;
-}
-unsigned stdc_bit_floor_ui([[maybe_unused]] unsigned x) { return 0x5CU; }
-unsigned long stdc_bit_floor_ul([[maybe_unused]] unsigned long x) {
-  return 0x5DUL;
-}
-unsigned long long stdc_bit_floor_ull([[maybe_unused]] unsigned long long x) {
-  return 0x5EULL;
-}
-
-unsigned char stdc_bit_ceil_uc([[maybe_unused]] unsigned char x) {
-  return 0x6AU;
-}
-unsigned short stdc_bit_ceil_us([[maybe_unused]] unsigned short x) {
-  return 0x6BU;
-}
-unsigned stdc_bit_ceil_ui([[maybe_unused]] unsigned x) { return 0x6CU; }
-unsigned long stdc_bit_ceil_ul([[maybe_unused]] unsigned long x) {
-  return 0x6DUL;
-}
-unsigned long long stdc_bit_ceil_ull([[maybe_unused]] unsigned long long x) {
-  return 0x6EULL;
-}
+unsigned char stdc_bit_floor_uc(unsigned char x) { return 0x5AU; }
+unsigned short stdc_bit_floor_us(unsigned short x) { return 0x5BU; }
+unsigned stdc_bit_floor_ui(unsigned x) { return 0x5CU; }
+unsigned long stdc_bit_floor_ul(unsigned long x) { return 0x5DUL; }
+unsigned long long stdc_bit_floor_ull(unsigned long long x) { return 0x5EULL; }
+
+unsigned char stdc_bit_ceil_uc(unsigned char x) { return 0x6AU; }
+unsigned short stdc_bit_ceil_us(unsigned short x) { return 0x6BU; }
+unsigned stdc_bit_ceil_ui(unsigned x) { return 0x6CU; }
+unsigned long stdc_bit_ceil_ul(unsigned long x) { return 0x6DUL; }
+unsigned long long stdc_bit_ceil_ull(unsigned long long x) { return 0x6EULL; }
 
 __END_C_DECLS
diff --git a/libc/test/integration/src/pthread/pthread_mutex_test.cpp b/libc/test/integration/src/pthread/pthread_mutex_test.cpp
index d482dcc13f443..d41ad6daf426d 100644
--- a/libc/test/integration/src/pthread/pthread_mutex_test.cpp
+++ b/libc/test/integration/src/pthread/pthread_mutex_test.cpp
@@ -23,7 +23,7 @@ constexpr int MAX = 10000;
 pthread_mutex_t mutex;
 static int shared_int = START;
 
-void *counter([[maybe_unused]] void *arg) {
+void *counter(void *arg) {
   int last_count = START;
   while (true) {
     LIBC_NAMESPACE::pthread_mutex_lock(&mutex);
@@ -72,7 +72,7 @@ void relay_counter() {
 pthread_mutex_t start_lock, step_lock;
 bool started, step;
 
-void *stepper([[maybe_unused]] void *arg) {
+void *stepper(void *arg) {
   LIBC_NAMESPACE::pthread_mutex_lock(&start_lock);
   started = true;
   LIBC_NAMESPACE::pthread_mutex_unlock(&start_lock);
diff --git a/libc/test/integration/src/spawn/posix_spawn_test.cpp b/libc/test/integration/src/spawn/posix_spawn_test.cpp
index 9e10ef1d5ec15..3c8cc7317b537 100644
--- a/libc/test/integration/src/spawn/posix_spawn_test.cpp
+++ b/libc/test/integration/src/spawn/posix_spawn_test.cpp
@@ -45,8 +45,7 @@ void spawn_and_wait_for_normal_exit(char **envp) {
   ASSERT_EQ(exit_status, 0);
 }
 
-TEST_MAIN([[maybe_unused]] int argc, [[maybe_unused]] char **argv,
-          char **envp) {
+TEST_MAIN(int argc, char **argv, char **envp) {
   spawn_and_wait_for_normal_exit(envp);
   return 0;
 }
diff --git a/libc/test/integration/src/spawn/posix_spawn_test_binary.cpp b/libc/test/integration/src/spawn/posix_spawn_test_binary.cpp
index f25337affaf16..c1b0cd671da71 100644
--- a/libc/test/integration/src/spawn/posix_spawn_test_binary.cpp
+++ b/libc/test/integration/src/spawn/posix_spawn_test_binary.cpp
@@ -2,7 +2,7 @@
 #include <string.h>
 #include <unistd.h>
 
-int main(int argc, [[maybe_unused]] char **argv) {
+int main(int argc, char **argv) {
   if (argc != 1)
     return 5;
   constexpr size_t bufsize = sizeof(TEXT);
diff --git a/libc/test/integration/src/stdio/sprintf_size_test.cpp b/libc/test/integration/src/stdio/sprintf_size_test.cpp
index ac1f085d330dc..833159436d49c 100644
--- a/libc/test/integration/src/stdio/sprintf_size_test.cpp
+++ b/libc/test/integration/src/stdio/sprintf_size_test.cpp
@@ -38,7 +38,7 @@ static int my_strlen(const char *str) {
   return static_cast<int>(other - str);
 }
 
-TEST_MAIN(int argc, char **argv, [[maybe_unused]] char **envp) {
+TEST_MAIN(int argc, char **argv, char **envp) {
   ASSERT_EQ(argc, 5);
   ASSERT_TRUE(my_streq(argv[1], "%s %c %d"));
   ASSERT_EQ(my_strlen(argv[1]), 8);
diff --git a/libc/test/integration/src/stdlib/getenv_test.cpp b/libc/test/integration/src/stdlib/getenv_test.cpp
index 72dcea0ddf1f1..82a9b89533d2e 100644
--- a/libc/test/integration/src/stdlib/getenv_test.cpp
+++ b/libc/test/integration/src/stdlib/getenv_test.cpp
@@ -27,8 +27,7 @@ static bool my_streq(const char *lhs, const char *rhs) {
   return *l == '\0' && *r == '\0';
 }
 
-TEST_MAIN([[maybe_unused]] int argc, [[maybe_unused]] char **argv,
-          [[maybe_unused]] char **envp) {
+TEST_MAIN(int argc, char **argv, char **envp) {
   ASSERT_TRUE(
       my_streq(LIBC_NAMESPACE::getenv(""), static_cast<char *>(nullptr)));
   ASSERT_TRUE(
diff --git a/libc/test/integration/src/threads/cnd_test.cpp b/libc/test/integration/src/threads/cnd_test.cpp
index 4eaab9ac08bc1..8791c6adbaa69 100644
--- a/libc/test/integration/src/threads/cnd_test.cpp
+++ b/libc/test/integration/src/threads/cnd_test.cpp
@@ -100,7 +100,7 @@ namespace single_waiter_test {
 mtx_t waiter_mtx, main_thread_mtx;
 cnd_t waiter_cnd, main_thread_cnd;
 
-int waiter_thread_func([[maybe_unused]] void *unused) {
+int waiter_thread_func(void *unused) {
   LIBC_NAMESPACE::mtx_lock(&waiter_mtx);
 
   LIBC_NAMESPACE::mtx_lock(&main_thread_mtx);
diff --git a/libc/test/integration/src/threads/mtx_test.cpp b/libc/test/integration/src/threads/mtx_test.cpp
index 0b0a9faae24a6..82b0350af97af 100644
--- a/libc/test/integration/src/threads/mtx_test.cpp
+++ b/libc/test/integration/src/threads/mtx_test.cpp
@@ -23,7 +23,7 @@ constexpr int MAX = 10000;
 mtx_t mutex;
 static int shared_int = START;
 
-int counter([[maybe_unused]] void *arg) {
+int counter(void *arg) {
   int last_count = START;
   while (true) {
     LIBC_NAMESPACE::mtx_lock(&mutex);
@@ -74,7 +74,7 @@ void relay_counter() {
 mtx_t start_lock, step_lock;
 bool started, step;
 
-int stepper([[maybe_unused]] void *arg) {
+int stepper(void *arg) {
   LIBC_NAMESPACE::mtx_lock(&start_lock);
   started = true;
   LIBC_NAMESPACE::mtx_unlock(&start_lock);
diff --git a/libc/test/integration/src/unistd/execv_test.cpp b/libc/test/integration/src/unistd/execv_test.cpp
index bdd54d420760c..254ef955f2720 100644
--- a/libc/test/integration/src/unistd/execv_test.cpp
+++ b/libc/test/integration/src/unistd/execv_test.cpp
@@ -52,8 +52,7 @@ void fork_and_execv_signal_exit() {
   ASSERT_TRUE(WTERMSIG(status) == SIGUSR1);
 }
 
-TEST_MAIN([[maybe_unused]] int argc, [[maybe_unused]] char **argv,
-          [[maybe_unused]] char **envp) {
+TEST_MAIN(int argc, char **argv, char **envp) {
   fork_and_execv_normal_exit();
   fork_and_execv_signal_exit();
   return 0;
diff --git a/libc/test/integration/src/unistd/execve_test.cpp b/libc/test/integration/src/unistd/execve_test.cpp
index 1204de3984c7e..fb1a83da63856 100644
--- a/libc/test/integration/src/unistd/execve_test.cpp
+++ b/libc/test/integration/src/unistd/execve_test.cpp
@@ -52,8 +52,7 @@ void fork_and_execv_signal_exit(char **envp) {
   ASSERT_TRUE(WTERMSIG(status) == SIGUSR1);
 }
 
-TEST_MAIN([[maybe_unused]] int argc, [[maybe_unused]] char **argv,
-          char **envp) {
+TEST_MAIN(int argc, char **argv, char **envp) {
   fork_and_execv_normal_exit(envp);
   fork_and_execv_signal_exit(envp);
   return 0;
diff --git a/libc/test/integration/src/unistd/fork_test.cpp b/libc/test/integration/src/unistd/fork_test.cpp
index 7eeefa4477806..010f57a7d2448 100644
--- a/libc/test/integration/src/unistd/fork_test.cpp
+++ b/libc/test/integration/src/unistd/fork_test.cpp
@@ -159,8 +159,7 @@ void gettid_test() {
   ASSERT_EQ(WEXITSTATUS(status), 0);
 }
 
-TEST_MAIN([[maybe_unused]] int argc, [[maybe_unused]] char **argv,
-          [[maybe_unused]] char **envp) {
+TEST_MAIN(int argc, char **argv, char **envp) {
   gettid_test();
   fork_and_wait_normal_exit();
   fork_and_wait4_normal_exit();
diff --git a/libc/test/integration/src/unistd/getcwd_test.cpp b/libc/test/integration/src/unistd/getcwd_test.cpp
index 5e5c0fa83a3cb..1b321b01e9315 100644
--- a/libc/test/integration/src/unistd/getcwd_test.cpp
+++ b/libc/test/integration/src/unistd/getcwd_test.cpp
@@ -17,8 +17,7 @@
 
 using LIBC_NAMESPACE::cpp::string_view;
 
-TEST_MAIN([[maybe_unused]] int argc, [[maybe_unused]] char **argv,
-          [[maybe_unused]] char **envp) {
+TEST_MAIN(int argc, char **argv, char **envp) {
   char buffer[1024];
   ASSERT_TRUE(string_view(LIBC_NAMESPACE::getenv("PWD")) ==
               LIBC_NAMESPACE::getcwd(buffer, 1024));
diff --git a/libc/test/integration/startup/linux/main_without_envp.cpp b/libc/test/integration/startup/linux/main_without_envp.cpp
index 894f43083faee..d2c24f4bd9f14 100644
--- a/libc/test/integration/startup/linux/main_without_envp.cpp
+++ b/libc/test/integration/startup/linux/main_without_envp.cpp
@@ -8,4 +8,4 @@
 
 #include "test/IntegrationTest/test.h"
 
-TEST_MAIN([[maybe_unused]] int argc, [[maybe_unused]] char **argv) { return 0; }
+TEST_MAIN(int argc, char **argv) { return 0; }
diff --git a/libc/test/integration/startup/linux/tls_test.cpp b/libc/test/integration/startup/linux/tls_test.cpp
index 097c8cd0967d9..de3bd06c39cf6 100644
--- a/libc/test/integration/startup/linux/tls_test.cpp
+++ b/libc/test/integration/startup/linux/tls_test.cpp
@@ -15,8 +15,7 @@
 constexpr int threadLocalDataSize = 101;
 _Thread_local int a[threadLocalDataSize] = {123};
 
-TEST_MAIN([[maybe_unused]] int argc, [[maybe_unused]] char **argv,
-          [[maybe_unused]] char **envp) {
+TEST_MAIN(int argc, char **argv, char **envp) {
   ASSERT_TRUE(a[0] == 123);
 
   for (int i = 1; i < threadLocalDataSize; ++i)
diff --git a/libc/test/src/__support/CPP/integer_sequence_test.cpp b/libc/test/src/__support/CPP/integer_sequence_test.cpp
index 590fb4ede4cda..fe378522b446b 100644
--- a/libc/test/src/__support/CPP/integer_sequence_test.cpp
+++ b/libc/test/src/__support/CPP/integer_sequence_test.cpp
@@ -23,8 +23,7 @@ TEST(LlvmLibcIntegerSequencetTest, Basic) {
       (is_same_v<ULLSeq, make_integer_sequence<unsigned long long, 4>>));
 }
 
-template <typename T, T... Ts>
-bool checkArray([[maybe_unused]] integer_sequence<T, Ts...> seq) {
+template <typename T, T... Ts> bool checkArray(integer_sequence<T, Ts...> seq) {
   T arr[sizeof...(Ts)]{Ts...};
 
   for (T i = 0; i < static_cast<T>(sizeof...(Ts)); i++)
diff --git a/libc/test/src/__support/freelist_heap_test.cpp b/libc/test/src/__support/freelist_heap_test.cpp
index ea7310d1d0756..93e23619661a0 100644
--- a/libc/test/src/__support/freelist_heap_test.cpp
+++ b/libc/test/src/__support/freelist_heap_test.cpp
@@ -57,7 +57,7 @@ using LIBC_NAMESPACE::cpp::span;
     RunTest(*freelist_heap, freelist_heap->region().size());                   \
   }                                                                            \
   void LlvmLibcFreeListHeapTest##TestCase::RunTest(FreeListHeap &allocator,    \
-                                                   [[maybe_unused]] size_t N)
+                                                   size_t N)
 
 TEST_FOR_EACH_ALLOCATOR(CanAllocate, 2048) {
   constexpr size_t ALLOC_SIZE = 512;
diff --git a/libc/test/src/math/exhaustive/hypotf16_test.cpp b/libc/test/src/math/exhaustive/hypotf16_test.cpp
index a822fc433d170..f79041e6dbd77 100644
--- a/libc/test/src/math/exhaustive/hypotf16_test.cpp
+++ b/libc/test/src/math/exhaustive/hypotf16_test.cpp
@@ -20,9 +20,8 @@ struct Hypotf16Checker : public virtual LIBC_NAMESPACE::testing::Test {
   using FPBits = LIBC_NAMESPACE::fputil::FPBits<float16>;
   using StorageType = typename FPBits::StorageType;
 
-  uint64_t check(uint16_t x_start, uint16_t x_stop,
-                 [[maybe_unused]] uint16_t y_start, uint16_t y_stop,
-                 mpfr::RoundingMode rounding) {
+  uint64_t check(uint16_t x_start, uint16_t x_stop, uint16_t y_start,
+                 uint16_t y_stop, mpfr::RoundingMode rounding) {
     mpfr::ForceRoundingMode r(rounding);
     if (!r.success)
       return true;
diff --git a/libc/test/src/stdlib/StrfromTest.h b/libc/test/src/stdlib/StrfromTest.h
index e82c94499aa11..197165c68d587 100644
--- a/libc/test/src/stdlib/StrfromTest.h
+++ b/libc/test/src/stdlib/StrfromTest.h
@@ -357,7 +357,7 @@ class StrfromTest : public LIBC_NAMESPACE::testing::Test {
     ASSERT_STREQ_LEN(written, buff, "1.0e+01");
   }
 
-  void floatDecimalExpLongDoublePrec([[maybe_unused]] FunctionT func) {
+  void floatDecimalExpLongDoublePrec(FunctionT func) {
     // Mark as maybe_unused to silence unused variable
     // warning when long double is not 80-bit
     [[maybe_unused]] char buff[100];
@@ -422,7 +422,7 @@ class StrfromTest : public LIBC_NAMESPACE::testing::Test {
     ASSERT_STREQ_LEN(wri...
[truncated]

@saturn691 saturn691 merged commit 33fe635 into main Aug 12, 2025
19 of 20 checks passed
@saturn691 saturn691 deleted the revert-133643-vinay-issue-119281-wextra branch August 12, 2025 11:40
@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 12, 2025

LLVM Buildbot has detected a new failure on builder libc-riscv32-qemu-yocto-fullbuild-dbg running on rv32gc-qemu-system while building libc at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/196/builds/11245

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
[ RUN      ] LlvmLibcImaxAbsTest.Negative
[       OK ] LlvmLibcImaxAbsTest.Negative (52 us)
Ran 3 tests.  PASS: 3  FAIL: 0
[4300/4437] Running unit test libc.test.src.fcntl.creat_test
sh: line 1: /timer.11362: Permission denied
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcCreatTest.CreatAndOpen
[       OK ] LlvmLibcCreatTest.CreatAndOpen (1 ms)
Ran 1 tests.  PASS: 1  FAIL: 0
[4301/4437] Running unit test libc.test.src.fcntl.openat_test
FAILED: libc/test/src/fcntl/CMakeFiles/libc.test.src.fcntl.openat_test /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/build/libc/test/src/fcntl/CMakeFiles/libc.test.src.fcntl.openat_test 
cd /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/build/libc/test/src/fcntl && /home/libcrv32buildbot/cross.sh /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/build/libc/test/src/fcntl/libc.test.src.fcntl.openat_test.__build__
sh: line 1: /timer.11363: Permission denied
[==========] Running 2 tests from 1 test suite.
[ RUN      ] LlvmLibcUniStd.OpenAndReadTest
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/fcntl/openat_test.cpp:30: FAILURE
      Expected: 0
      Which is: 0
To be equal to: static_cast<int>(libc_errno)
      Which is: 2
[  FAILED  ] LlvmLibcUniStd.OpenAndReadTest
[ RUN      ] LlvmLibcUniStd.FailTest
[       OK ] LlvmLibcUniStd.FailTest (403 us)
Ran 2 tests.  PASS: 1  FAIL: 1
[4302/4437] Running unit test libc.test.src.fcntl.fcntl_test
sh: line 1: /timer.11380: Permission denied
[==========] Running 7 tests from 1 test suite.
[ RUN      ] LlvmLibcFcntlTest.FcntlDupfd
[       OK ] LlvmLibcFcntlTest.FcntlDupfd (2 ms)
[ RUN      ] LlvmLibcFcntlTest.FcntlGetFl
[       OK ] LlvmLibcFcntlTest.FcntlGetFl (861 us)
[ RUN      ] LlvmLibcFcntlTest.FcntlSetFl
[       OK ] LlvmLibcFcntlTest.FcntlSetFl (1 ms)
[ RUN      ] LlvmLibcFcntlTest.FcntlGetLkRead
[       OK ] LlvmLibcFcntlTest.FcntlGetLkRead (1 ms)
[ RUN      ] LlvmLibcFcntlTest.FcntlGetLkWrite
[       OK ] LlvmLibcFcntlTest.FcntlGetLkWrite (545 us)
[ RUN      ] LlvmLibcFcntlTest.UseAfterClose
[       OK ] LlvmLibcFcntlTest.UseAfterClose (481 us)
[ RUN      ] LlvmLibcFcntlTest.SetGetOwnerTest
[       OK ] LlvmLibcFcntlTest.SetGetOwnerTest (998 us)
Ran 7 tests.  PASS: 7  FAIL: 0
[4303/4437] Running unit test libc.test.src.poll.poll_test
sh: line 1: /timer.11399: Permission denied
[==========] Running 2 tests from 1 test suite.
[ RUN      ] LlvmLibcPollTest.SmokeTest
[       OK ] LlvmLibcPollTest.SmokeTest (439 us)
[ RUN      ] LlvmLibcPollTest.SmokeFailureTest
[       OK ] LlvmLibcPollTest.SmokeFailureTest (463 us)
Step 8 (libc-unit-tests) failure: libc-unit-tests (failure)
...
[ RUN      ] LlvmLibcImaxAbsTest.Negative
[       OK ] LlvmLibcImaxAbsTest.Negative (52 us)
Ran 3 tests.  PASS: 3  FAIL: 0
[4300/4437] Running unit test libc.test.src.fcntl.creat_test
sh: line 1: /timer.11362: Permission denied
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcCreatTest.CreatAndOpen
[       OK ] LlvmLibcCreatTest.CreatAndOpen (1 ms)
Ran 1 tests.  PASS: 1  FAIL: 0
[4301/4437] Running unit test libc.test.src.fcntl.openat_test
FAILED: libc/test/src/fcntl/CMakeFiles/libc.test.src.fcntl.openat_test /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/build/libc/test/src/fcntl/CMakeFiles/libc.test.src.fcntl.openat_test 
cd /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/build/libc/test/src/fcntl && /home/libcrv32buildbot/cross.sh /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/build/libc/test/src/fcntl/libc.test.src.fcntl.openat_test.__build__
sh: line 1: /timer.11363: Permission denied
[==========] Running 2 tests from 1 test suite.
[ RUN      ] LlvmLibcUniStd.OpenAndReadTest
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/fcntl/openat_test.cpp:30: FAILURE
      Expected: 0
      Which is: 0
To be equal to: static_cast<int>(libc_errno)
      Which is: 2
[  FAILED  ] LlvmLibcUniStd.OpenAndReadTest
[ RUN      ] LlvmLibcUniStd.FailTest
[       OK ] LlvmLibcUniStd.FailTest (403 us)
Ran 2 tests.  PASS: 1  FAIL: 1
[4302/4437] Running unit test libc.test.src.fcntl.fcntl_test
sh: line 1: /timer.11380: Permission denied
[==========] Running 7 tests from 1 test suite.
[ RUN      ] LlvmLibcFcntlTest.FcntlDupfd
[       OK ] LlvmLibcFcntlTest.FcntlDupfd (2 ms)
[ RUN      ] LlvmLibcFcntlTest.FcntlGetFl
[       OK ] LlvmLibcFcntlTest.FcntlGetFl (861 us)
[ RUN      ] LlvmLibcFcntlTest.FcntlSetFl
[       OK ] LlvmLibcFcntlTest.FcntlSetFl (1 ms)
[ RUN      ] LlvmLibcFcntlTest.FcntlGetLkRead
[       OK ] LlvmLibcFcntlTest.FcntlGetLkRead (1 ms)
[ RUN      ] LlvmLibcFcntlTest.FcntlGetLkWrite
[       OK ] LlvmLibcFcntlTest.FcntlGetLkWrite (545 us)
[ RUN      ] LlvmLibcFcntlTest.UseAfterClose
[       OK ] LlvmLibcFcntlTest.UseAfterClose (481 us)
[ RUN      ] LlvmLibcFcntlTest.SetGetOwnerTest
[       OK ] LlvmLibcFcntlTest.SetGetOwnerTest (998 us)
Ran 7 tests.  PASS: 7  FAIL: 0
[4303/4437] Running unit test libc.test.src.poll.poll_test
sh: line 1: /timer.11399: Permission denied
[==========] Running 2 tests from 1 test suite.
[ RUN      ] LlvmLibcPollTest.SmokeTest
[       OK ] LlvmLibcPollTest.SmokeTest (439 us)
[ RUN      ] LlvmLibcPollTest.SmokeFailureTest
[       OK ] LlvmLibcPollTest.SmokeFailureTest (463 us)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants